<template>
  <div class="demo">
    <h1>{{msg}}</h1>
    <h2>学生名字:{{ name }}</h2>
    <button @click="sendData">点我发送数据</button>
  </div>
</template>

<script>
import pubsub from 'pubsub-js'
export default {
  name: 'veu-student',
  data() {
    return {
      msg:'欢迎来到德莱联盟',
      name:'张三',
    }
  },
  methods:{
    sendData() {
      //发布消息
      pubsub.publish('receiveData',this.name);
    }
  }
}
</script>


<style scoped>
.demo {
  background-color: skyblue;
}
</style>